use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use rust_decimal::Decimal;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "vehicles")]
pub struct Model {
    #[sea_orm(primary_key, auto_increment = false)]
    pub id: String,
    pub license_plate: String,
    pub model: String,
    pub max_weight: Decimal,
    pub max_volume: Decimal,
    pub vehicle_type: i32, // 0: truck, 1: van, 2: refrigerated
    pub status: i32, // 0: available, 1: in_use, 2: maintenance, 3: out_of_service
    pub driver_id: Option<String>,
    pub created_at: DateTime,
    pub updated_at: DateTime,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}

impl ActiveModelBehavior for ActiveModel {}